<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			    xmlns:ui="http://java.sun.com/jsf/facelets"
			    xmlns:h="http://java.sun.com/jsf/html"
			    xmlns:f="http://java.sun.com/jsf/core"    
			    template="./template/template_login.xhtml">
    
    <ui:define name="title">
        Listado de Proveedores
    </ui:define>
    
    <ui:define name="content">        			
			<h:form id="listadoProveedoresForm" styleClass="fields">								
				<f:event listener="#{suppliersBean.populateTable}" type="preRenderView" />
								
				<div class="box box-100 altbox">
					<div class="boxin">
						<div class="header">
							<h3>Listado de Proveedores</h3>
							<h:commandLink action="#{suppliersBean.goAddSupplier}" value="Nuevo Proveedor" styleClass="button"/>		
						</div>
						<div class="content">
							<h:dataTable value="#{suppliersBean.suppliersList}" var="row">
				
								<h:column>		
									<ul class="actions">
									 	<li>
											<h:commandLink action="#{suppliersBean.goEditSupplier}" styleClass="ico">	
												<f:param name="provId" value="#{row.provId}" />	
												<h:graphicImage value="resources/images/led-ico/pencil.png" alt="Modificar Proveedor" style="border:0;" />							 							 	
											</h:commandLink>				
										</li>
									</ul>
								</h:column>
								
								<h:column>		
									<f:facet name="header"> <h:outputLabel value="Nombre" /></f:facet>		
									#{row.name}
								</h:column>
																		
								<h:column>		
									<f:facet name="header"> <h:outputLabel value="Direccion"/></f:facet>		
									#{row.address}
								</h:column>
							
								<h:column>
									<f:facet name="header"><h:outputLabel value="Tel. Casa" /></f:facet>
									#{row.phoneNumber}
								</h:column>
								
								<h:column>
									<f:facet name="header"><h:outputLabel value="Tel. Celular" /></f:facet>
									#{row.cellPhoneNumber}
								</h:column>			
																	
							</h:dataTable>	
						</div>										
					</div>					
				</div>
																								
			</h:form>			
	</ui:define>
    
</ui:composition>